import { BaseEntity } from "../../base/entity/base";
import { Column, Entity } from "typeorm";

export enum ScheduleStatus {
    UNKNOWN = 0,
    FREE = 1,
    BUSY = 2,
}

export enum ScheduleSource {
    CAR = 0,
    PROVIDER = 1,
    OTHER = 2
}

@Entity('transport_schedule', { comment: '运力排班' })
export class TransportScheduleEntity extends BaseEntity {
    @Column({ comment: '运力ID', nullable: false })
    capacityId: number

    @Column({ comment: '日期', type: 'date', nullable: false })
    date: Date

    @Column({ comment: '状态', type: 'enum', enum: ScheduleStatus, default: ScheduleStatus.UNKNOWN })
    status: ScheduleStatus

    @Column({ comment: '排班备注', type: 'text', nullable: true })
    remark: string

    @Column({ comment: '来源', type: 'enum', enum: ScheduleSource, default: ScheduleSource.OTHER })
    source: ScheduleSource

}